name: pre-commit run_id: commands[0] env HOME: /home/jenkins env LANG: C.UTF-8 env PATH: /w/workspace/bgpcep-tox-verify-master/.tox/pre-commit/bin:/opt/pyenv/bin:/tmp/venv-Awxt/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin env PIP_DISABLE_PIP_VERSION_CHECK: 1 env PYTHONHASHSEED: 2663270567 env PYTHONIOENCODING: utf-8 env SSH_AUTH_SOCK: ******************************** env TOX_ENV_DIR: /w/workspace/bgpcep-tox-verify-master/.tox/pre-commit env TOX_ENV_NAME: pre-commit env TOX_WORK_DIR: /w/workspace/bgpcep-tox-verify-master/.tox env VIRTUAL_ENV: /w/workspace/bgpcep-tox-verify-master/.tox/pre-commit env __TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI: true metadata pid: 2385 cwd: /w/workspace/bgpcep-tox-verify-master allow: /w/workspace/bgpcep-tox-verify-master/.tox/pre-commit/bin/* cmd: pre-commit run --all-files --show-diff-on-failure exit_code: 1 [WARNING] hook id `remove-tabs` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [WARNING] repo `https://github.com/pre-commit/pre-commit-hooks` uses deprecated stage names (commit, push) which will be removed in a future version. Hint: often `pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks` will fix this. if it does not -- consider reporting an issue to that repo. [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... trim trailing whitespace.................................................Failed - hook id: trailing-whitespace - exit code: 1 - files were modified by this hook Fixing tests/libraries/flowspec.py Fixing tests/libraries/pcep.py Fixing tests/libraries/infra.py Fixing tests/libraries/bgp.py Fixing tests/libraries/prefix_counting.py Fixing tests/suites/bgp_userfeatures/test_080_bgp_functional_rt_constrain.py Fixing tests/suites/bgp_userfeatures/test_bgp_app_peer_basic.py Fixing tests/suites/bgp_userfeatures/test_060_bgp_functional_mvpn.py Fixing tests/suites/bgp_userfeatures/test_050_bmp_basic.py Fixing tests/suites/bgp_userfeatures/test_ebgp_peers_basic.py Fixing tests/suites/bgp_userfeatures/test_bgp_functional_md5.py Fixing tests/suites/bgp_userfeatures/test_040_bgp_functional_route_ref.py Fixing tests/suites/bgp_userfeatures/test_bgp_policies_default.py Fixing tests/suites/bgp_userfeatures/test_030_bgp_functional_evpn.py Fixing tests/suites/bgp_userfeatures/test_basic.py Fixing tests/suites/bgp_userfeatures/test_bgp_llgr_basic.py Fixing tests/libraries/utils.py Fixing tests/suites/bgp_userfeatures/test_ibgp_peer_lsp.py Fixing tests/suites/bgp_userfeatures/test_ibgp_peers_basic.py Fixing tests/suites/bgp_userfeatures/test_bgp_ipv6_basic.py Fixing tests/suites/bgp_userfeatures/test_090_bgp_functional_rt_constrain_validation.py Fixing tests/suites/bgp_userfeatures/test_020_bgp_functional_multipath.py Fixing tests/suites/bgp_userfeatures/test_010_bgp_functional_l3vpn.py Fixing tests/suites/bgp_userfeatures/test_010_bgp_flowspec.py Fixing tests/suites/bgp_userfeatures/test_070_bgp_functional_l3vpn_mcast.py Fixing tests/conftest.py Tabs remover.............................................................Failed - hook id: remove-tabs - exit code: 1 - files were modified by this hook Substituting tabs in: tests/suites/bgp_userfeatures/test_080_bgp_functional_rt_constrain.py by 4 whitespaces Tabs have been successfully removed. Now aborting the commit. You can check the changes made. Then simply "git add --update ." and re-commit Substituting tabs in: tests/suites/bgp_userfeatures/test_070_bgp_functional_l3vpn_mcast.py by 4 whitespaces Tabs have been successfully removed. Now aborting the commit. You can check the changes made. Then simply "git add --update ." and re-commit Substituting tabs in: tests/suites/bgp_userfeatures/test_010_bgp_functional_l3vpn.py by 4 whitespaces Tabs have been successfully removed. Now aborting the commit. You can check the changes made. Then simply "git add --update ." and re-commit Substituting tabs in: tests/suites/bgp_userfeatures/test_060_bgp_functional_mvpn.py by 4 whitespaces Tabs have been successfully removed. Now aborting the commit. You can check the changes made. Then simply "git add --update ." and re-commit Substituting tabs in: tests/suites/bgp_userfeatures/test_030_bgp_functional_evpn.py by 4 whitespaces Tabs have been successfully removed. Now aborting the commit. You can check the changes made. Then simply "git add --update ." and re-commit pre-commit hook(s) made changes. If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`. To run `pre-commit` as part of git workflow, use `pre-commit install`. All changes made by hooks: diff --git a/tests/conftest.py b/tests/conftest.py index 58a2ac1ec9..1bc6c89c24 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -111,14 +111,14 @@ def step_tag_checker(request: pytest.FixtureRequest) -> Callable[[Optional[List[ """ Returns a function that checks if a step should run based on tags. Reads --step-include and --step-exclude command-line options. - + Logic mimics Robot Framework: 1. If --step-include is used, the step *must* match one tag. 2. If --step-exclude is used, the step *must not* match any tag. """ include_str = request.config.getoption("--step-include") exclude_str = request.config.getoption("--step-exclude") - + include_tags = set(include_str.split(',')) if include_str else set() exclude_tags = set(exclude_str.split(',')) if exclude_str else set() diff --git a/tests/libraries/bgp.py b/tests/libraries/bgp.py index baf96f7489..81feae3928 100644 --- a/tests/libraries/bgp.py +++ b/tests/libraries/bgp.py @@ -304,7 +304,7 @@ def start_bgp_speaker( allf: bool | None = None, evpn: bool | None = None, mvpn: bool | None = None, - l3vpn_mcast: bool | None = None, + l3vpn_mcast: bool | None = None, rt_constrain: bool | None = None, wfr: int | None = None, cluster: str | None = None, @@ -507,7 +507,7 @@ def start_bgp_app_peer( log_file: str = "bgp_app_peer.log", timeout: int = 1200, ) -> tuple[int, str]: - """??? NOt necessary always to have these parames and if not provided skip them + """??? NOt necessary always to have these parames and if not provided skip them and not provide to the scrpt count, prefix: str = "8.0.0.0", prefix_len: int = 28,""" """Starts bgp_app_peer.py for manipulating BGP neighbour rib table. @@ -569,7 +569,7 @@ def start_exabgp( if log_file: command += f" > tmp/{log_file}" - + process = infra.shell(command, run_in_background=True) return process @@ -629,7 +629,7 @@ def start_gobgp( """??? """ command = f"{gobgp_path} -l debug -f {cfg_file} > tmp/gobgp.log" - + process = infra.shell(command, run_in_background=True) return process diff --git a/tests/libraries/flowspec.py b/tests/libraries/flowspec.py index 1b19d59141..5c0256836b 100644 --- a/tests/libraries/flowspec.py +++ b/tests/libraries/flowspec.py @@ -17,7 +17,7 @@ RESTCONF_PORT = variables.RESTCONF_PORT TOOLS_IP = variables.TOOLS_IP log = logging.getLogger(__name__) - + def verify_flowspec_data_is_empty(): templated_requests.get_templated_request("variables/bgpflowspec/empty_route", None, verify=True) diff --git a/tests/libraries/infra.py b/tests/libraries/infra.py index 1611298598..08a3ab1a4c 100644 --- a/tests/libraries/infra.py +++ b/tests/libraries/infra.py @@ -97,7 +97,7 @@ def shell( except FileNotFoundError: log.error(f"ERROR command not found: {exec_command}") return None, None - + def read_until(process: subprocess.Popen, expected_text: str, timeout: int = 10): "This exepcted text must be within one line, it can not spread across mutliple lines" found_event = threading.Event() @@ -111,7 +111,7 @@ def read_until(process: subprocess.Popen, expected_text: str, timeout: int = 10) if line and expected_text in line: found_event.set() return - + queue = Queue() thread = threading.Thread(target=threaded_read, args=(process.stdout, expected_text, queue), daemon=True) thread.start() @@ -451,7 +451,7 @@ def stop_process_by_pid(pid: int, gracefully: bool = True, timeout: int | None = log.info(f"Sending signal {signal_to_be_sent} to process with PID {pid}") process = psutil.Process(pid) process.send_signal(signal_to_be_sent) - + if timeout is not None: # check if it is still running try: @@ -462,7 +462,7 @@ def stop_process_by_pid(pid: int, gracefully: bool = True, timeout: int | None = raise AssertionError( f"Was not able to stop process with PID {process.pid}, it is still running." ) from e - + def download_file(url: str): file_name = url.split("/")[-1] urllib.request.urlretrieve(url, f"tmp/{file_name}") @@ -470,7 +470,7 @@ def download_file(url: str): def get_file_content(path: str): with open(path, "r", encoding="utf-8") as file: content = file.read() - + return content diff --git a/tests/libraries/pcep.py b/tests/libraries/pcep.py index fb3b4d319c..663b4573d2 100644 --- a/tests/libraries/pcep.py +++ b/tests/libraries/pcep.py @@ -100,7 +100,7 @@ def configure_speaker_entitiy_identifier(): resposne = templated_requests.put_templated_request( "variables/pcepuser/titanium/node_speaker_entity_identifier", mapping, json=False ) - + return resposne def add_lsp(xml_data): @@ -119,7 +119,7 @@ def update_lsp(xml_data): #resposne = templated_requests.post_templated_request( # "data/templates/pcep_update_lsp", mapping, json=False #) - # + # #return resposne response = operate_xml_lsp_return_json("network-topology-pcep:update-lsp", xml_data) return response diff --git a/tests/libraries/prefix_counting.py b/tests/libraries/prefix_counting.py index 17afae2c6e..64fa4a2865 100644 --- a/tests/libraries/prefix_counting.py +++ b/tests/libraries/prefix_counting.py @@ -144,7 +144,7 @@ def wait_for_ipv4_topology_prefixes_to_become_stable( raise AssertionError( f"Expected Ipv4 topology to be stable after {timeout} seconds" ) - + def verify_ip_topology_is_empty(): templated_requests.get_templated_request("variables/bgpuser/empty_topology", None, verify=True) diff --git a/tests/libraries/utils.py b/tests/libraries/utils.py index 6d655325e8..397a0c29c4 100644 --- a/tests/libraries/utils.py +++ b/tests/libraries/utils.py @@ -38,7 +38,7 @@ def verify_jsons_matach(json1: str, json2: str, json1_data_label: str = "json1", if len(visual_diff) > 2000: visual_diff = visual_diff[:2000] + " ... (truncated long output)" raise AssertionError(f": \n{visual_diff}") - + def verify_multiline_text_match(expected_text: str, real_text: str): @@ -158,7 +158,7 @@ def wait_until_function_returns_value_with_custom_value_validator( f"Failed to execute {function.__name__}({','.join([str(arg) for arg in args])} {kwargs or ''}) " \ f"after {retry_count} attempts." ) from last_exception - + def verify_function_never_passes_within_timeout( retry_count: int, interval: int, function: Callable, *args, **kwargs ) -> Any: @@ -175,7 +175,7 @@ def verify_function_never_passes_within_timeout( else: raise AssertionError("Function did pass within timeout") - + def verify_process_did_not_stop_immediately( pid: int, retry_count: int = 10, interval: int = 1 ): @@ -194,7 +194,7 @@ def verify_process_did_not_stop_immediately( verify_function_returns_concrete_value_for_some_time( retry_count, interval, True, infra.is_process_still_running, pid ) - + def verify_function_does_not_fail_within_timeout( retry_count: int, interval: int, function: Callable, *args, **kwargs ) -> Any: diff --git a/tests/suites/bgp_userfeatures/test_010_bgp_flowspec.py b/tests/suites/bgp_userfeatures/test_010_bgp_flowspec.py index 0bf058c3fe..c29e52ea6e 100644 --- a/tests/suites/bgp_userfeatures/test_010_bgp_flowspec.py +++ b/tests/suites/bgp_userfeatures/test_010_bgp_flowspec.py @@ -38,7 +38,7 @@ log = logging.getLogger(__name__) @pytest.mark.usefixtures("teardown_kill_all_running_play_script_processes") @pytest.mark.run(order=15) class TestBgpFlowspec: - + def set_bgp_peer_configuration(self): """??? """ @@ -96,5 +96,5 @@ class TestBgpFlowspec: """Deconfigure BGP peer.""" self.delete_bgp_peer_configuration() - + diff --git a/tests/suites/bgp_userfeatures/test_010_bgp_functional_l3vpn.py b/tests/suites/bgp_userfeatures/test_010_bgp_functional_l3vpn.py index d2613f2123..030b5619c1 100644 --- a/tests/suites/bgp_userfeatures/test_010_bgp_functional_l3vpn.py +++ b/tests/suites/bgp_userfeatures/test_010_bgp_functional_l3vpn.py @@ -10,12 +10,12 @@ # BGP peer as follows: # # Functional test suite for bgp - l3vpn-ipv4 -# +# # This suite tests advertising and receiveing routes with l3vpn content. It -# uses odl and exabgp as bgp peers. Routes advertized from odl are configured +# uses odl and exabgp as bgp peers. Routes advertized from odl are configured # via application peer. Routes advertised from exabgp is statically configured # in exabgp config file. -# For fluorine and further, instead of exabgp, play.py is used. When sending +# For fluorine and further, instead of exabgp, play.py is used. When sending # routes from odl to peer, first route containg route-target argument # have to be send from peer to odl, so odl can identify this peer. Than it # sends l3vpn route containg this argument to odl app peer, and we check @@ -71,7 +71,7 @@ class TestBgpfunctionalL3Vpn: templated_requests.delete_templated_request( f"{RT_CONSTRAIN_DIR}/bgp_peer", mapping ) - + def verify_reported_data(self, tempalate_path): """Verifies expected response""" templated_requests.get_templated_request(tempalate_path, None, verify=True) @@ -88,12 +88,12 @@ class TestBgpfunctionalL3Vpn: infra.shell("cp variables/bgpfunctional/l3vpn_ipv4/bgp-l3vpn-ipv4.cfg tmp/") infra.shell(f"sed -i -e 's/EXABGPIP/{TOOLS_IP}/g' tmp/bgp-l3vpn-ipv4.cfg") infra.shell(f"sed -i -e 's/ODLIP/{ODL_IP}/g' tmp/bgp-l3vpn-ipv4.cfg") - + def test_bgp_functional_l3vpn(self, allure_step_with_separate_logging): with allure_step_with_separate_logging("step_prepare_config_files"): """???.""" self.prepare_config_files() - + with allure_step_with_separate_logging("step_configure_app_peer"): """Configures bgp application peer. Openconfig is used for carbon and above.""" bgp.set_bgp_application_peer(ip=ODL_IP) @@ -140,5 +140,5 @@ class TestBgpfunctionalL3Vpn: self.delete_bgp_peer_configuration() with allure_step_with_separate_logging("step_deconfigure_app_peer"): - """ Revert the BGP configuration to the original state: without application peer""" + """ Revert the BGP configuration to the original state: without application peer""" bgp.delete_bgp_application_peer(ip=ODL_IP) diff --git a/tests/suites/bgp_userfeatures/test_020_bgp_functional_multipath.py b/tests/suites/bgp_userfeatures/test_020_bgp_functional_multipath.py index 65c9b971d1..3f286f8a79 100644 --- a/tests/suites/bgp_userfeatures/test_020_bgp_functional_multipath.py +++ b/tests/suites/bgp_userfeatures/test_020_bgp_functional_multipath.py @@ -10,7 +10,7 @@ # BGP peer as follows: # # Functional test suite for bgp - n-path and all-path selection -# +# # This suite tests n-path and all-path selection policy. # It uses odl and exabgp as bgp peers. Routes advertized from # odl are configured via application peer. @@ -146,9 +146,9 @@ class TestBgpfunctionalMultipath: templated_requests.delete_templated_request(f"{MULT_VAR_FOLDER}/route", route_mapping) mapping = {"IP": TOOLS_IP, "BGP_RIB_OPENCONFIG": PROTOCOL_OPENCONFIG} templated_requests.delete_templated_request(f"{BGP_VAR_FOLDER}/app_peer", mapping) - + def test_bgp_functional_multipath(self, allure_step_with_separate_logging): - + with allure_step_with_separate_logging("step_test_suite_setup"): self.setup_config_files() self.store_rib_configuration() diff --git a/tests/suites/bgp_userfeatures/test_030_bgp_functional_evpn.py b/tests/suites/bgp_userfeatures/test_030_bgp_functional_evpn.py index 1a4c6065eb..7a2644415c 100644 --- a/tests/suites/bgp_userfeatures/test_030_bgp_functional_evpn.py +++ b/tests/suites/bgp_userfeatures/test_030_bgp_functional_evpn.py @@ -10,7 +10,7 @@ # BGP peer as follows: # # Functional test suite for bgp - evpn -# +# # This suite tests advertising and receiveing routes with evpn content. # It uses play.py and odl as bgp peers. Routes advertized from odl are # configured via application peer. Routes advertised from play.py are stored @@ -162,7 +162,7 @@ class TestBgpfunctionalEvpn: finally: self.withdraw_route_and_verify(withdraw_hex) - + def verify_reported_data(self, tempalate_path): """Verifies expected response""" templated_requests.get_templated_request(tempalate_path, None, verify=True) @@ -170,7 +170,7 @@ class TestBgpfunctionalEvpn: def wait_until_expected_data(self, template_path, retry_count=20, interval=1): utils.wait_until_function_pass(retry_count, interval, self.verify_reported_data, template_path) - + def test_bgp_functional_evpn(self, allure_step_with_separate_logging): with allure_step_with_separate_logging("step_configure_app_peer"): """Configures bgp application peer. Openconfig is used for carbon and above.""" @@ -415,5 +415,5 @@ class TestBgpfunctionalEvpn: self.delete_bgp_peer_configuration() with allure_step_with_separate_logging("step_deconfigure_app_peer"): - """ Revert the BGP configuration to the original state: without application peer""" + """ Revert the BGP configuration to the original state: without application peer""" self.delete_app_peer() diff --git a/tests/suites/bgp_userfeatures/test_040_bgp_functional_route_ref.py b/tests/suites/bgp_userfeatures/test_040_bgp_functional_route_ref.py index e5e842aefc..478420508e 100644 --- a/tests/suites/bgp_userfeatures/test_040_bgp_functional_route_ref.py +++ b/tests/suites/bgp_userfeatures/test_040_bgp_functional_route_ref.py @@ -10,7 +10,7 @@ # BGP peer as follows: # # Functional test for bgp - route refresh -# +# # This suite tests sending and receiveing route refresh message. # It uses odl and exabgp as bgp peers. Sending route refresh message # from odl is initiated via restconf. If route refresh is received by odl, @@ -92,7 +92,7 @@ class TestBgpfunctionalRouteRef: log.info(f"Expected state: {exp_state}") line_count = exp_state.find("\n") + 1 real_state = "\n".join(stdout.splitlines()[MSG_STATE_OFFSET:MSG_STATE_OFFSET+line_count]) - utils.verify_multiline_text_match(exp_state, real_state) + utils.verify_multiline_text_match(exp_state, real_state) def verify_odl_operational_state_count(self, notification_count: int, update_count: int, receive_count: int): """Check notification and update count gained from operatial neighbor state @@ -114,9 +114,9 @@ class TestBgpfunctionalRouteRef: bgp.stop_bgp_speaker(self.exabgp_process) mapping = {"PREFIX": prefix, "APP_RIB": ODL_IP} templated_requests.delete_templated_request(f"{BGP_RR_VAR_FOLDER}/route", mapping) - + def test_bgp_functional_route_ref(self, allure_step_with_separate_logging): - + with allure_step_with_separate_logging("step_test_suite_setup"): self.setup_config_files() diff --git a/tests/suites/bgp_userfeatures/test_050_bmp_basic.py b/tests/suites/bgp_userfeatures/test_050_bmp_basic.py index 89804cf9e8..8af60bf033 100644 --- a/tests/suites/bgp_userfeatures/test_050_bmp_basic.py +++ b/tests/suites/bgp_userfeatures/test_050_bmp_basic.py @@ -7,7 +7,7 @@ # # # This is a basic test for bgp monitoring protocol feature. After the feature -# odl-bgpcep-bmp installation, the port 12345 should be bound for listening. +# odl-bgpcep-bmp installation, the port 12345 should be bound for listening. # To test this feature bgp-bmp-mock tool is used. It is a part of the bgpcep project. # It is a java tool which simulates more peers and more routers. In this particular # test suite it simulates 1 peer with 1 router, which means it advertizes one peer diff --git a/tests/suites/bgp_userfeatures/test_060_bgp_functional_mvpn.py b/tests/suites/bgp_userfeatures/test_060_bgp_functional_mvpn.py index f357beae19..433f657a88 100644 --- a/tests/suites/bgp_userfeatures/test_060_bgp_functional_mvpn.py +++ b/tests/suites/bgp_userfeatures/test_060_bgp_functional_mvpn.py @@ -10,7 +10,7 @@ # BGP peer as follows: # # Functional test suite for bgp - mvpn -# +# # This suite tests advertising mvpn routes to odl. For advertising play.py # is used, and particular files are stored as *.hex files. There are # 7 different types of routes used for auto-discovery of multicast network. @@ -91,7 +91,7 @@ class TestBgpfunctionalMvpn: templated_requests.delete_templated_request( f"{MVPN_DIR}/bgp_peer", mapping ) - + def test_bgp_functional_Mvpn(self, allure_step_with_separate_logging): with allure_step_with_separate_logging("step_configure_app_peer"): """Configures bgp application peer.""" @@ -189,5 +189,5 @@ class TestBgpfunctionalMvpn: self.delete_bgp_peer_configuration() with allure_step_with_separate_logging("step_deconfigure_app_peer"): - """ Revert the BGP configuration to the original state: without application peer""" + """ Revert the BGP configuration to the original state: without application peer""" self.delete_app_peer() diff --git a/tests/suites/bgp_userfeatures/test_070_bgp_functional_l3vpn_mcast.py b/tests/suites/bgp_userfeatures/test_070_bgp_functional_l3vpn_mcast.py index 3a55572a03..a0623b2be2 100644 --- a/tests/suites/bgp_userfeatures/test_070_bgp_functional_l3vpn_mcast.py +++ b/tests/suites/bgp_userfeatures/test_070_bgp_functional_l3vpn_mcast.py @@ -10,7 +10,7 @@ # BGP peer as follows: # # Functional test suite for bgp - l3vpn-mutlicast -# +# # This suite tests advertising l3vpn_mcast routes to odl. For advertising # play.py is used, and particular files are stored as *.hex files.There are # L3vpn-ipv4-multicast routes and L3vpn-ipv6-multicast routes tested. @@ -91,7 +91,7 @@ class TestBgpfunctionalL3vpnMcast: templated_requests.delete_templated_request( f"{L3VPN_MCAST_DIR}/bgp_peer", mapping ) - + def test_bgp_functional_l3vpn_mcast(self, allure_step_with_separate_logging): with allure_step_with_separate_logging("step_configure_app_peer"): """Configures bgp application peer.""" @@ -132,5 +132,5 @@ class TestBgpfunctionalL3vpnMcast: self.delete_bgp_peer_configuration() with allure_step_with_separate_logging("step_deconfigure_app_peer"): - """ Revert the BGP configuration to the original state: without application peer""" + """ Revert the BGP configuration to the original state: without application peer""" self.delete_app_peer() diff --git a/tests/suites/bgp_userfeatures/test_080_bgp_functional_rt_constrain.py b/tests/suites/bgp_userfeatures/test_080_bgp_functional_rt_constrain.py index f344a6eff4..ab2442d9e1 100644 --- a/tests/suites/bgp_userfeatures/test_080_bgp_functional_rt_constrain.py +++ b/tests/suites/bgp_userfeatures/test_080_bgp_functional_rt_constrain.py @@ -10,7 +10,7 @@ # BGP peer as follows: # # Functional test suite for bgp - route-target-constrain safi -# +# # This suite tests advertising rt-constrain routes to odl. For advertising # from peer, play.py is used, sending hex messages to odl. For advertising # to app-peer, we are sending post requests with routes in xml. @@ -91,7 +91,7 @@ class TestBgpfunctionalRtConstrain: templated_requests.delete_templated_request( f"{RT_CONSTRAIN_DIR}/bgp_peer", mapping ) - + def test_bgp_functional_rt_constrain(self, allure_step_with_separate_logging): with allure_step_with_separate_logging("step_configure_app_peer"): """Configures bgp application peer.""" @@ -144,5 +144,5 @@ class TestBgpfunctionalRtConstrain: self.delete_bgp_peer_configuration() with allure_step_with_separate_logging("step_deconfigure_app_peer"): - """ Revert the BGP configuration to the original state: without application peer""" + """ Revert the BGP configuration to the original state: without application peer""" self.delete_app_peer() diff --git a/tests/suites/bgp_userfeatures/test_090_bgp_functional_rt_constrain_validation.py b/tests/suites/bgp_userfeatures/test_090_bgp_functional_rt_constrain_validation.py index 705803fa2a..974110b2be 100644 --- a/tests/suites/bgp_userfeatures/test_090_bgp_functional_rt_constrain_validation.py +++ b/tests/suites/bgp_userfeatures/test_090_bgp_functional_rt_constrain_validation.py @@ -7,7 +7,7 @@ # # Functional test for bgp - route-target-constrain safi # -# This suite tests advertising rt-constrain routes to odl. For advertising +# This suite tests advertising rt-constrain routes to odl. For advertising # from peer play.py is used, sending hex messages to odl. # There are 3 peers: ebgp and two ibgps. First peer sends l3vpn route with # specific RT to odl, second peer sends RT route and third peer only @@ -105,7 +105,7 @@ class TestBgpfunctionalRtConstrainValidation: def verify_empty_reproted_data(self): """Verify empty data response""" templated_requests.get_templated_request(f"{RT_CONSTRAIN_DIR}/empty_l3vpn", mapping=ADJ_RIB_OUT, verify=True) - + def test_bgp_functional_rt_constrain_validation(self, allure_step_with_separate_logging): with allure_step_with_separate_logging("step_reconfigure_odl_to_accept_connection"): """Configures BGP peer module with initiate-connection set to false.""" @@ -121,7 +121,7 @@ class TestBgpfunctionalRtConstrainValidation: templated_requests.put_templated_request( EBGP_DIR, mapping, json=False ) - + with allure_step_with_separate_logging("step_start_bgp_peers"): """Start Python speaker to connect to ODL. We give each speaker time until odl really starts to accept incoming bgp connection. The failure happens if the incoming connection comes too quickly after configuring the peer.""" diff --git a/tests/suites/bgp_userfeatures/test_basic.py b/tests/suites/bgp_userfeatures/test_basic.py index 203819db24..2326307bc4 100644 --- a/tests/suites/bgp_userfeatures/test_basic.py +++ b/tests/suites/bgp_userfeatures/test_basic.py @@ -36,7 +36,7 @@ # - check empty topology # - reconfigre neighbor without peer-group, delete peer-group # -# Brief description how to perform BGP functional test: +# Brief description how to perform BGP functional test: # https://wiki.opendaylight.org/view/BGP_LS_PCEP:Lithium_Feature_Tests#How_to_test_2 import json @@ -238,7 +238,7 @@ class TestBasic: with allure_step_with_separate_logging("step_check_listening_connection_is_established"): """See TCP (BGP) connection in established state.""" - self.check_speaker_is_connected() + self.check_speaker_is_connected() with allure_step_with_separate_logging("step_check_listening_topology_is_filled"): """See new routes in example-ipv4-topology as a proof that synchronization was correct.""" diff --git a/tests/suites/bgp_userfeatures/test_bgp_app_peer_basic.py b/tests/suites/bgp_userfeatures/test_bgp_app_peer_basic.py index 72cd9a4b5d..cefbb24e90 100644 --- a/tests/suites/bgp_userfeatures/test_bgp_app_peer_basic.py +++ b/tests/suites/bgp_userfeatures/test_bgp_app_peer_basic.py @@ -185,7 +185,7 @@ class TestBgpAppPeerBasic: with allure_step_with_separate_logging("step_tc3_reconnect_bgp_peer_and_check_incomming_updates_for_3_introduced_prefixes"): """Start BGP peer tool.""" self.bgp_speaker_process = bgp.start_bgp_speaker(0, my_ip=TOOLS_IP, log_level="debug") - + utils.verify_process_did_not_stop_immediately(self.bgp_speaker_process.pid) infra.wait_for_string_in_file(20, 1, "nlri_prefix_received:", "bgp_peer.log", threshold=3) infra.verify_string_occurence_count_in_file("nlri_prefix_received:", "bgp_peer.log", 3) diff --git a/tests/suites/bgp_userfeatures/test_bgp_functional_md5.py b/tests/suites/bgp_userfeatures/test_bgp_functional_md5.py index 6f1ea5c0b9..cdd4f7b47e 100644 --- a/tests/suites/bgp_userfeatures/test_bgp_functional_md5.py +++ b/tests/suites/bgp_userfeatures/test_bgp_functional_md5.py @@ -47,7 +47,7 @@ class TestBgpFunctionalMd5: def reconfigure_odl_to_accept_connections(self, password: str): mapping = {"BGP_RIB_OPENCONFIG": "example-bgp-rib", "IP": TOOLS_IP, - "HOLDTIME": 180, + "HOLDTIME": 180, "PEER_PORT": 17900, "PASSWORD": password, "PASSIVE_MODE": "true"} @@ -87,6 +87,6 @@ class TestBgpFunctionalMd5: exabgp_process = bgp.start_exabgp_and_verify_connected("tmp/exa-md5.cfg", ODL_IP, expect_connected=False) bgp.stop_exabgp(exabgp_process) self.delete_bgp_peer_configuration() - - + + diff --git a/tests/suites/bgp_userfeatures/test_bgp_ipv6_basic.py b/tests/suites/bgp_userfeatures/test_bgp_ipv6_basic.py index 6bb2e9634d..56b51cc2d8 100644 --- a/tests/suites/bgp_userfeatures/test_bgp_ipv6_basic.py +++ b/tests/suites/bgp_userfeatures/test_bgp_ipv6_basic.py @@ -174,7 +174,7 @@ class TestBgpIpv6Basic: """Save exabgp logs as exaipv6.log, and stop exabgp with ctrl-c bash signal.""" infra.shell(f"cp tmp/{EXABGP_LOG} results/") bgp.stop_exabgp(self.exabgp_process) - + with allure_step_with_separate_logging("step_configure_app_peer"): """Configures bgp application peer.""" mapping = {"IP": "127.0.0.12", "BGP_RIB_OPENCONFIG": "example-bgp-rib"} diff --git a/tests/suites/bgp_userfeatures/test_bgp_llgr_basic.py b/tests/suites/bgp_userfeatures/test_bgp_llgr_basic.py index 50af9f177b..c8b3a27db3 100644 --- a/tests/suites/bgp_userfeatures/test_bgp_llgr_basic.py +++ b/tests/suites/bgp_userfeatures/test_bgp_llgr_basic.py @@ -5,7 +5,7 @@ # terms of the Eclipse Public License v1.0 which accompanies this distribution, # and is available at http://www.eclipse.org/legal/epl-v10.html # -# This suite tests simple connection between one ibgp peer (goabgp) and Odl. +# This suite tests simple connection between one ibgp peer (goabgp) and Odl. # Peer is configured with ipv6, and gobgp connectes to odl via ipv6. import json @@ -42,11 +42,11 @@ class TestBgpLlgrBasic: def reconfigure_odl_to_accept_connections(self): mapping = {"BGP_RIB_OPENCONFIG": "example-bgp-rib", "IP": TOOLS_IP, - "HOLDTIME": 180, + "HOLDTIME": 180, "PEER_PORT": 17900, "PASSIVE_MODE": "true"} templated_requests.put_templated_request("variables/bgpfunctional/ipv6/bgp_peer", mapping, json=False) - + def delete_bgp_peer_configuration(self): mapping = {"BGP_RIB_OPENCONFIG": "example-bgp-rib", "IP":TOOLS_IP } templated_requests.delete_templated_request("variables/bgpfunctional/ipv6/bgp_peer", mapping) @@ -72,7 +72,7 @@ class TestBgpLlgrBasic: with allure_step_with_separate_logging("step_reconfigure_odl_to_accept_connections"): """Configure BGP peer modules with initiate-connection set to false with short ipv6 address.""" self.reconfigure_odl_to_accept_connections() - + with allure_step_with_separate_logging("step_start_gobgp"): """Starts gobgp peer simulator.""" self.gobgp_process = bgp.start_gobgp_and_verify_connected(f"tmp/gobgpd", f"tmp/{GOBGP_CFG}", TOOLS_IP) diff --git a/tests/suites/bgp_userfeatures/test_bgp_policies_default.py b/tests/suites/bgp_userfeatures/test_bgp_policies_default.py index f18ec90ef2..eb392fbdbf 100644 --- a/tests/suites/bgp_userfeatures/test_bgp_policies_default.py +++ b/tests/suites/bgp_userfeatures/test_bgp_policies_default.py @@ -91,20 +91,20 @@ class TestBgpPoliciesDefault: mapping = {"IP": ODL_IP,"BGP_RIB_OPENCONFIG": "example-bgp-rib"} templated_requests.post_templated_request(f"{POLICIES_VAR}/app_peer", mapping, json=False) templated_requests.post_templated_request(f"{POLICIES_VAR}/app_peer_route", mapping, json=False) - + with allure_step_with_separate_logging("step_reconfigure_odl_to_accept_connections"): """Configure BGP peer modules with initiate-connection set to false. Configures 6 different peers, two internal, two external and two route-reflectors.""" for index, peer_type in enumerate(PEER_TYPES): mapping = {"IP": f"127.0.0.{index+2}", "BGP_RIB_OPENCONFIG": RIB_INSTANCE, "RIB_INSTACE_NAME": RIB_INSTANCE, "HOLDTIME": HOLDTIME, "PASSIVE_MODE": "true"} templated_requests.put_templated_request(f"{POLICIES_VAR}/{peer_type}", mapping, json=False) - + with allure_step_with_separate_logging("step_start_exabgps"): """Start 6 exabgps as processes in background, each with it's own configuration.""" for index in range(1, 7): exabgp_process = bgp.start_exabgp(f"tmp/exabgp{index}.cfg", log_file=f"exa{index}.log") self.exabgp_processes.append(exabgp_process) - + with allure_step_with_separate_logging("step_verify_rib_filled"): """Verifies that sent routes are present in particular ribs.""" self.verify_rib_status() @@ -120,7 +120,7 @@ class TestBgpPoliciesDefault: for index, peer_type in enumerate(PEER_TYPES): mapping = {"IP": f"127.0.0.{index+2}", "BGP_RIB_OPENCONFIG": RIB_INSTANCE, "RIB_INSTACE_NAME": RIB_INSTANCE} templated_requests.delete_templated_request(f"{POLICIES_VAR}/{peer_type}", mapping) - + with allure_step_with_separate_logging("step_deconfigure_app_peer"): """Revert the BGP configuration to the original state: without application peer.""" mapping = {"IP": ODL_IP,"BGP_RIB_OPENCONFIG": "example-bgp-rib"} diff --git a/tests/suites/bgp_userfeatures/test_ebgp_peers_basic.py b/tests/suites/bgp_userfeatures/test_ebgp_peers_basic.py index 85bc36fc4a..59695a06cb 100644 --- a/tests/suites/bgp_userfeatures/test_ebgp_peers_basic.py +++ b/tests/suites/bgp_userfeatures/test_ebgp_peers_basic.py @@ -103,7 +103,7 @@ class TestEbgpPeersBasic: infra.execute_karaf_command(f"log:set {ODL_LOG_LEVEL}") infra.execute_karaf_command(f"log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep") infra.execute_karaf_command(f"log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol") - + with allure_step_with_separate_logging("step_tc1_configure_two_ibgp_route_reflector_client_peers"): """Configure two iBGP peers as routing reflector clients.""" self.configure_ibgp_peer(BGP_PEER1_IP, rr_client=True, cluster_id=False) @@ -265,7 +265,7 @@ class TestEbgpPeersBasic: in second peer which has local route-reflector-cluster-id.""" mapping = {"IP": BGP_PEER2_IP, "BGP_RIB_OPENCONFIG": "example-bgp-rib", "PEER_NUMBER": 1, "CLUSTER_ID": BGP_PEER1_IP, "DEFAULT_ID": "127.0.0.4"} utils.wait_until_function_pass(10, 1, templated_requests.get_templated_request, f"{BGP_DATA_FOLDER}/cluster_id/peer_rib_out", mapping, verify=True) - + with allure_step_with_separate_logging("step_tc4_disconnect_bgp_peers"): """Stop BGP peer & store logs.""" bgp.stop_bgp_speaker(self.bgp_peer1_process) diff --git a/tests/suites/bgp_userfeatures/test_ibgp_peer_lsp.py b/tests/suites/bgp_userfeatures/test_ibgp_peer_lsp.py index e015336939..6797fa129d 100644 --- a/tests/suites/bgp_userfeatures/test_ibgp_peer_lsp.py +++ b/tests/suites/bgp_userfeatures/test_ibgp_peer_lsp.py @@ -9,7 +9,7 @@ # peer operations and checks for IP4 topology updates and updates towards # BGP peer as follows: # -# +# # Basic tests for iBGP peers. # Test suite performs basic iBGP functional test case for carrying LSP State # Information in BGP as described in diff --git a/tests/suites/bgp_userfeatures/test_ibgp_peers_basic.py b/tests/suites/bgp_userfeatures/test_ibgp_peers_basic.py index 68ce2d6b10..02b75f26d1 100644 --- a/tests/suites/bgp_userfeatures/test_ibgp_peers_basic.py +++ b/tests/suites/bgp_userfeatures/test_ibgp_peers_basic.py @@ -107,7 +107,7 @@ class TestIbgpPeersBasic: infra.execute_karaf_command(f"log:set {ODL_LOG_LEVEL}") infra.execute_karaf_command(f"log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep") infra.execute_karaf_command(f"log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol") - + with allure_step_with_separate_logging("step_tc1_configure_two_ibgp_route_reflector_client_peers"): """Configure two iBGP peers as routing reflector clients.""" self.configure_ibgp_peer(BGP_PEER1_IP, rr_client=True, cluster_id=False) @@ -269,7 +269,7 @@ class TestIbgpPeersBasic: in second peer which has local route-reflector-cluster-id.""" mapping = {"IP": BGP_PEER2_IP, "BGP_RIB_OPENCONFIG": "example-bgp-rib", "PEER_NUMBER": 1, "CLUSTER_ID": BGP_PEER1_IP, "DEFAULT_ID": "127.0.0.4"} utils.wait_until_function_pass(10, 1, templated_requests.get_templated_request, f"{BGP_DATA_FOLDER}/cluster_id/peer_rib_out", mapping, verify=True) - + with allure_step_with_separate_logging("step_tc4_disconnect_bgp_peers"): """Stop BGP peer & store logs.""" bgp.stop_bgp_speaker(self.bgp_peer1_process)